﻿using System;
using System.IO;

namespace LabSolutions
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = null;
            using (StreamReader sr = new StreamReader("input.txt"))
            {
                input = sr.ReadToEnd();
            }            
            //string[] inputNumbers = input.Split(' ');
            //double a = double.Parse(inputNumbers[0]);
            double a = double.Parse(input);
            double z1 = Math.Pow((1 + a + a * a) / (2 * a + a * a) + 2 - (1 - a + a * a) / (2 * a - a * a), -1) * (5 - 2 * a * a);
            double z2 = (4 - a * a) / 2;
            using (StreamWriter sw = new StreamWriter("output.txt"))
            {
                sw.WriteLine(z1.ToString("0.00000"));
                sw.Write(z2.ToString("0.00000"));
            }            
        }
    }
}
